home *** CD-ROM | disk | FTP | other *** search
/ Unreal Tournament Game Programming for Teens / UnrealTournamentGameProgrammingForTeens.iso / Chapter Files / Chapter10 / Quote.txt < prev   
Encoding:
Text File  |  2006-10-28  |  3.9 KB  |  118 lines

  1.  
  2.    class Quote extends Actor;
  3.  
  4.    var private string ActionMessage;
  5.  
  6.    var private Array<string> GrouchoArray;
  7.    var private Array<string> KarlArray;
  8.    var private Array<string> GBArray;
  9.  
  10.  
  11.    public function string GetAQuote(){
  12.        local string SingleQuote;
  13.        SingleQuote = GetSingleQuote();
  14.        return SingleQuote;
  15.    }
  16.  
  17.  
  18.    public function MakeQuotes(){
  19.         SetArraysOfQuotes();
  20.    }
  21.  
  22. private function SetArraysOfQuotes(){
  23.  
  24.    //Groucho Marx
  25.    local string GrouchoSays, KarlSays, GeorgeSays;
  26.    local int Count, Itr;
  27.  
  28.    GrouchoSays =
  29.    "Either he's dead or my watch has stopped. " $ Chr(10) $
  30.    "And I want to thank you for all the " $
  31.    "enjoyment you've taken out of it. " $ Chr(10) $
  32.    "All people are born alike - " $
  33.    "except Republicans and Democrats. " $ Chr(10) $
  34.    "I don't care to belong to a club that " $
  35.    "accepts people like me as members. " $ Chr(10) $
  36.    "I must confess, I was born at a very early age. " 
  37.    $ Chr(10) $
  38.    "I worked my way up from nothing "$
  39.    "to a state of extreme poverty. " $ Chr(10) $
  40.    "Military intelligence is a contradiction in terms. " 
  41.    $ Chr(10) $
  42.    "No man goes before his time - "$
  43.    "unless the boss leaves early. " $ Chr(10) $
  44.    "The secret of life is honesty and fair dealing." $
  45.    " If you can fake that, you've got it made. " $ Chr(10) $
  46.    "A hospital bed is a parked taxi with the meter running. ";
  47.    
  48.    Count = Split(GrouchoSays, Chr(10), GrouchoArray);
  49.  
  50.  
  51.    KarlSays =
  52.    "Experience praises the most happy the " $
  53.    "one who made the most people happy. " $ Chr(10) $
  54.    "For the bureaucrat, the world is a " $
  55.    "mere object to be manipulated... " $ Chr(10) $
  56.    "From each according to his abilities, " $
  57.    "to each according to his needs. " $ Chr(10) $
  58.    "Go on, get out. Last words are for "$
  59.    "fools who haven't said enough. " $ Chr(10) $
  60.    "Necessity is blind until it becomes conscious. " $
  61.    "Freedom is the consciousness of necessity. " $ Chr(10) $
  62.    "Nothing can have value without being an object of utility. " 
  63.    $ Chr(10) $
  64.    "Reason has always existed, "$ 
  65.    "but not always in a reasonable form. " $ Chr(10) $
  66.    "Religion is the opium of the masses. " $ Chr(10) $
  67.    "Revolutions are the locomotives of history. " $ Chr(10) $
  68.    "The production of too many useful things " $
  69.    "results in too many useless people. ";
  70.    Count = Split(KarlSays, Chr(10), KarlArray);
  71.  
  72.  
  73.  
  74.    GeorgeSays =
  75.    "All great truths begin as blasphemies. " $ Chr(10) $
  76.    "A government that robs Peter to pay Paul" $
  77.    "can always depend on the support of Paul. " $ Chr(10) $
  78.    "A life spent making mistakes is not only more "$
  79.    "honorable but more useful than " $
  80.    "a life spent doing nothing. " $ Chr(10) $
  81.    "A doctorÆs reputation is made by the number of eminent" $
  82.    "men who die under his care. " $ Chr(10) $
  83.    "All great truths begin as blasphemies. " $ Chr(10) $
  84.    "Baseball has the great advantage over cricket" $
  85.    " of being sooner ended. " $ Chr(10) $
  86.    "If all the economists in the world were laid end to end, "
  87.    $"they wouldnÆt reach any conclusion. " $ Chr(10) $
  88.    "Martyrdom: The only way a man can become famous "$
  89.    "without ability. " $ Chr(10) $
  90.    "My reputation grows with every failure. " $ Chr(10) $
  91.    "One man that has a mind and knows it can "$
  92.    "always beat ten men who haven't and don't.";
  93.    Count = Split(GeorgeSays, Chr(10), GBArray);
  94.  
  95.    }//end of SetArraysOfQuotes
  96.  
  97.  
  98.    private function string GetSingleQuote(){
  99.       local string Quote;
  100.       local int Ctr;
  101.       Ctr = Rand(3);
  102.       switch(Ctr){
  103.          case 0:
  104.              Quote = KarlArray[ Rand(Rand(KarlArray.Length) ) ];
  105.             break;
  106.          case 1:
  107.            Quote = GrouchoArray[ Rand(GrouchoArray.Length) ];
  108.             break;
  109.          case 2:
  110.             Quote = GBArray[ Rand(GBArray.Length) ];
  111.          break;
  112.          default:
  113.       }//end switch
  114.       return Quote;
  115.    }//end GetSingleQuote
  116.  
  117.  
  118.